<?php
	include_once("Login.php");
	
	$conn = new mysqli($host,$user,$passwd, $database)
	or die("SQL connect error: ".mysqli_connect_error());

	$body = file_get_contents('php://input');
	$xml = simplexml_load_string($body);
	
	$username = $xml->username;
	$query = "SELECT Username, Password, Salt,Id FROM User WHERE Username='$username'";
	
	$result = mysqli_query($conn, $query);

	$dom  = new DOMDocument;
    	$dom->formatOutput = TRUE; // enable automatic indenting
    	$dom->loadXML('<node/>'); // set root node

	$u = '';
	$p = '';
	$s = '';
	$i = '';
	while($row = mysqli_fetch_array($result))
	{
		$u = $row['Username'];
		$p = $row['Password'];
		$s = $row['Salt'];
		$i = $row['Id'];
	}
	echo "<node><u>$u</u><p>$p</p><s>$s</s><i>$i</i></node>";
	mysqli_close($conn);
?>